Name: Huimiao Chen, JHED ID: hchen185, Email: hchen185@jhu.edu.

  1. Look at the chapter on interactive graphics and, specifically, the code to display a subject's MRICloud data as a sunburst plot. Do the following. Display this subject's data as a Sankey diagram. Display as many levels as you can (at least 3) for Type = 1, starting from the intracranial volume. Put this in a file called hw4.ipynb.
In [1]:
                roi  volume                      level4              level3  \
0             SFG_L   12926                       SFG_L           Frontal_L   
1             SFG_R   10050                       SFG_R           Frontal_R   
2         SFG_PFC_L   12783                       SFG_L           Frontal_L   
3         SFG_PFC_R   11507                       SFG_R           Frontal_R   
4        SFG_pole_L    3078                       SFG_L           Frontal_L   
..              ...     ...                         ...                 ...   
275  Chroid_LVetc_L     444  AnteriorLateralVentricle_L  LateralVentricle_L   
276  Chroid_LVetc_R     371  AnteriorLateralVentricle_R  LateralVentricle_R   
277    IV_ventricle    2700                IV_ventricle        IV_ventricle   
278          ECCL_L     292                  inf_DPWM_L        InferiorWM_L   
279          ECCL_R     292                  inf_DPWM_R        InferiorWM_R   

               level2           level1  icv      comp  
0    CerebralCortex_L  Telencephalon_L  ICV  0.009350  
1    CerebralCortex_R  Telencephalon_R  ICV  0.007270  
2    CerebralCortex_L  Telencephalon_L  ICV  0.009247  
3    CerebralCortex_R  Telencephalon_R  ICV  0.008324  
4    CerebralCortex_L  Telencephalon_L  ICV  0.002227  
..                ...              ...  ...       ...  
275        Ventricle               CSF  ICV  0.000321  
276        Ventricle               CSF  ICV  0.000268  
277         Ventricle              CSF  ICV  0.001953  
278     WhiteMatter_L  Telencephalon_L  ICV  0.000211  
279     WhiteMatter_R  Telencephalon_R  ICV  0.000211  

[280 rows x 8 columns]
PHG_LSylvianFissureExt_RSTG_L_polemidbrain_LCingulate_LSMG_RHypoThalamus_RPrCuWM_LPeripheralCingulateWM_LCerebellumWM_RFx_RFx/ST_RPoCG_RCentralSul_LMOG_LPons_RPosteriorLateralVentricle_RLFOWM_RIFWM_orbitalis_RCerebellumWM_RSylParieSul_LAGWM_RLG_LIFG_opercularis_LML_RCerebellumWM_LIII_ventricleCSFMFOWM_LAnteriorWM_RFuG_LSPG_RMOG_RCaud_RLG_LThalamus_LOccipital_RFx/ST_LOcciptSul_LSCC_RPLIC_LFimbria_LPVWa_LSPG_RCuWM_LGP_RRLIC_LENT_LCaudate_tail_RTempSul_LALIC_RCinguSul_RMesencephalonPCT_RCGH_LInsula_LMOG_RSylTempSul_RPLIC_LMFOG_RInsula_RPeripheralOccipitalWM_RMFWM_LThalamus_Rant_DPWM_RBasalForebrain_LLV_Inferior_RIFWM_triangularis_RITWM_RMOWM_LThalamus_RSFG_RIFWM_opercularis_LSnigra_LCaudate_tail_LsubcallosalWM_ACC_RIFG_LInferiorLateralVentricle_LThalamus_RSFO_RSMWM_LPosteriorWM_RCGH_LMetencephalonMFG_LIOG_LPosteriorWM_LLV_Frontal_RMetencephalon_LLG_Rinf_DPWM_LFrontSul_LCST_RPrCu_LFuG_LIFG_triangularis_RRG_RSFG_pole_RSFWM_pole_LSPG_LICP_cb_ROcciptSul_LPeripheralOccipitalWM_LSPG_LPut_LTelencephalon_RTempSul_RCu_LLateralVentricle_RICP_LCaud_LHippo_LIFWM_triangularis_LIFG_orbitalis_RLimbicWM_RPrCG_LBCC_LsubcallosalWM_ACC_LSTG_LLimbic_RAG_RCGC_LCorpusCallosum_RAnteriorLateralVentricle_LLV_Frontal_LSFG_PFC_RFrontSul_RCinguSul_LPVA_anterior_LParietSul_LFuWM_LSFO_LBasalGang_LGCC_LrostralWM_ACC_LMOG_LMTG_LPVWl_LSS_RCuWM_RMedulla_Rmidbrain_LSTG_LCerebellumGM_Rrostral_ACC_RPeripheralCingulateWM_RdorsalWM_ACC_RCaudate_tail_LPVA_posterior_LFx/ST_RCaud_RPLIC_RCl_RMFWM_DPFC_LSMWM_RAGWM_LPeripheralParietalWM_RENT_RPrCu_LPeripheralTemporalWM_RSFWM_RRLIC_RThalamus_LLV_atrium_LIFG_triangularis_LSLF_LOccipital_LPCR_LCP_LRGWM_LSulcus_Lmidbrain_RLV_body_RPons_LCGC_LInferiorLateralVentricle_RSTWM_R_poleFrontSul_RSOG_RPoCG_LNucAccumbens_RChroid_LVetc_LPCCWM_LPCR_RCentralSul_LPut_LSFWM_pole_RWhiteMatter_ROG_RPons_LIII_ventriclePVA_anterior_RSMG_Lsubgenual_ACC_RPrCu_RBasalForebrain_LITG_RHippo_ROG_LCl_LVentricle Ventriclemidbrain_RIV_ventricleSFG_LBasalForebrain_LSTG_RPVWa_RIOG_LSylvianFissureExt_LCentralSul_RAmyg_RPCCWM_RSylFrontSul_RCerebellum_LAG_RSCP_RFrontSul_Lrostral_ACC_LSOG_LIFG_orbitalis_LsubgenualWM_ACC_RCentralSul_RSylTempSul_LCaudate_tail_RSPWM_RPrCWM_RCST_LParietSul_RFuWM_RSOG_LMFOG_LBasalForebrain_RRedNc_RSTG_R_poleSFWM_LPVA_posterior_RMetencephalon_RSFWM_PFC_LIOG_RInsula_LMedulla_RCerebellumWM_LSylTempSul_RPons_RITG_LEC_RWhiteMatter_LParietal_RGP_Linf_DPWM_RMesencephalon_RInsula_RDiencephalon_RParietSul_LBasalForebrain_RAnteriorWM_LFx_LRG_LSylParieSul_RSLF_RRGWM_RMFG_DPFC_RPrCu_RGP_LTemporal_LInferiorWM_LITWM_LMidbrain_LAG_LCGH_RICP_cb_Lsubcallosal_ACC_RIII_ventricleSS_LMCP_RML_LAmyg_RMOWM_RPoCWM_RRG_LOcciptSul_RPeripheralTemporalWM_LAmyg_LLV_body_LParietal_LDiencephalon_LPrCuWM_RFimbria_RSulcus_RMFOWM_RFuG_RMTWM_L_poleALIC_LMedulla_RLimbic_RThalamus_LSFG_RPTR_LSFG_pole_LPLIC_RInferiorWM_RInsula_LECCL_LCerebralCortex_RRG_RSCR_RLV_atrium_RMidbrain_RPTR_ROcciptSul_LPHG_RLFOG_LMCP_cb_LCu_RITG_RCinguSul_LCerebellum_LHypoThalamus_LSylFrontSul_LSylParieSul_RIV_ventricleHippo_LPrCG_RCingulate_RSylFrontSul_RMammillary_LCGC_RTempSul_RSCC_RrostralWM_ACC_RCerebellum_RSMG_RAG_LLV_Inferior_LACR_RPons_LMFG_LLimbic_LMedulla_LBasalForebrain_RSTWM_L_polePons_RSCR_LHippo_RLateralVentricle_LBCC_RPrCWM_LMTG_LAnteriorLateralVentricle_RThalamus_RALIC_RCerebellumGM_LSFG_LTempSul_RMTG_RSCP_LMyelencephalon_LMTG_L_poleFrontSul_RSPWM_LEC_LPeripheralParietalWM_LMTG_RMesencephalon_LGCC_RCGC_RMammillary_RPrCG_LBasalForebrain_RLGWM_RFx_RICVMTG_R_poleGCC_LICP_RCinguSul_RGCC_RLG_RSylFrontSul_LSFG_PFC_LIFWM_orbitalis_LNucAccumbens_LLV_Occipital_Rpost_DPWM_RChroid_LVetc_RParietSul_RPoCWM_LPrCG_RInsula_RPCC_RSMG_LFuG_RLV_Occipital_LBCC_RPCT_LMyelencephalon_RAmyg_LIOG_RECCL_RIFG_opercularis_RACR_LLGWM_LsubgenualWM_ACC_Lpost_DPWM_LSCC_LMedulla_LCinguSul_Lant_DPWM_LFrontSul_LOcciptSul_RMCP_cb_RFx/ST_LIOWM_LTempSul_LCerebellum_RCu_RCerebralNucli_RMFWM_RCP_RCinguSul_RLimbic_LPVWp_LSCC_LSylTempSul_LPoCG_LPCC_LMFG_RMedulla_LLimbicWM_LPosteriorLateralVentricle_Lsubgenual_ACC_LSFWM_PFC_Rdorsal_ACC_RLFOWM_LParietSul_LLFOG_RCorpusCallosum_LSOG_RBasalGang_RBasalForebrain_LALIC_LOcciptSul_RThalamus_LPoCG_RdorsalWM_ACC_LGP_RIFWM_opercularis_RSOWM_LCerebralNucli_LMTWM_LMyelencephalonCentralSul_LITG_LMCP_LPVWl_RSTWM_RPut_RBCC_LIV_ventricleIFG_RSTWM_LMTWM_R_poleIOWM_RIFO_LCaud_Ldorsal_ACC_LMTWM_RSylParieSul_LSOWM_RPut_RSTG_RIFO_RMFG_DPFC_Lsubcallosal_ACC_LPVWp_RCu_LParietSul_RTempSul_LMFWM_DPFC_RRedNc_LSnigra_RCentralSul_RCGH_RCerebralCortex_LTelencephalon_LFrontal_LTemporal_RFrontal_RFx_LPeripheralFrontalWM_LMFG_RPeripheralFrontalWM_R
Structure of the intracranial volumeSource: Multi-level MRICloud data: kirby21AllLevels
  1. Create a simple webpage containing this graphic and host it on github pages. -Do not- host this off of your assignment repo from github classroom, since this is not public. Instead, you'll have to create a new public repo from your regular github account and add this file. Put the link to your live web page in a markdown cell of your hw4.ipynb file. Note, an easy way to create a webpage with this graphic is to export an ipynb as an html file.
In [2]:
  1. Create the opioid sqlite database from https://smart-stats.github.io/ds4bio_book/book/_build/html/sqlite.html. However, only go to the step where the csv files are read into the database. Then exit sqlite and you should have a file opioid.db that has the data. Next, read the three tables into pandas dataframes and do the data wrangling from the sqlite chapter directly in pandas. Add the python code to your hw4.ipynb file.
In [ ]:
  1. Create an interactive scatter plot of average number of opiod pills by year plot using plotly. See the example here. Don't do the intervals (little vertical lines), only the points. Add your plot to an html file with your repo for your Sanky diagram and host it publicly. Put a link to your hosted file in a markdown cell of your hw4.ipynb file. Note, an easy way to create a webpage with this graphic is to export an ipynb as an html file.
In [3]: